import { createStore } from "vuex";
import storage from "../utils/storage";
import mutations from "./mutations";
// 把mutation统一封装到mutation的文件中，进行统一管理
// 做数据的持久化
// 做项目的原则，从简单入手
const state = {
  userInfo: storage.getItem("userInfo") || {},
  menuList: storage.getItem("menuList") || [],
  actionList: storage.getItem("actionList") || [],
};

export default createStore({
  state,
  mutations,
});
